(function($) {
	$(function() {
		$("#edit-sls-ldbar").change(function() {
            var selected = $('input:radio:checked', $(this)).val();
            switch (selected) {
                case 'pie':
                    $('.form-item-sls-pie-position').show();
                    $('.form-item-sls-bar-position').hide();
                    $('.form-item-sls-bar-direction').hide();
                    break;

                case 'bar':
                    $('.form-item-sls-pie-position').hide();
                    $('.form-item-sls-bar-position').show();
                    $('.form-item-sls-bar-direction').show();
                    break;

                case 'none':
                    $('.form-item-sls-pie-position').hide();
                    $('.form-item-sls-bar-position').hide();
                    $('.form-item-sls-bar-direction').hide();
                    break;
            }
		}).trigger("change");
	});
})(jQuery);
